# -*- coding: utf-8 -*- 

import urllib2
import cookielib


cj=cookielib.CookieJar()
url1='http://detail.tmall.com/item.htm?id=19922402179'
'''
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
url1='http://detail.tmall.com/item.htm?id=19922402179'
res=opener.open(url1)
#print res.read().decode('gbk').encode('utf8')
'''
opener3=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
url3='http://rate.taobao.com/member_rate.htm?callback=shop_rate_list&content=1&result=&from=rate&user_id=UvFNLvGHyMm8bvNTT&identity=1&rater=3&direction=1&page=3'
req=urllib2.Request(url3)
req.add_header('referer', url1)
res3=opener3.open(req)
print res3.read().decode('gbk').encode('utf8')

'''
opener4=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
url4='http://rate.tmall.com/list_detail_rate.htm?itemId=25158784329&spuId=215742447&sellerId=911757567'
req=urllib2.Request(url4)
req.add_header('referer', url1)
res4=opener4.open(req)
print res4.read().decode('gbk').encode('utf8')



opener2=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
url2='http://ext.mdskip.taobao.com/extension/dealRecords.htm?callback=jsonp1525&bid_page=1&page_size=15&is_start=false&item_type=b&ends=1395280862000&starts=1394676062000&item_id=18180411994&user_tag=35229728&old_quantity=79459&seller_num_id=871886077&isFromDetail=yes&totalSQ=87147&sbn=f0e5bea6cbcbe32703a5f60b7a820d08&sold_total_num=19272'
req=urllib2.Request(url2)
req.add_header('referer', url1)
res2=opener2.open(req)
print res2.read().decode('gbk').encode('utf8')



#url2='http://ext.mdskip.taobao.com/extension/dealRecords.htm?callback=jsonp1525&bid_page=1&page_size=15&is_start=false&item_type=b&ends=1395280862000&starts=1394676062000&item_id=18180411994&user_tag=35229728&old_quantity=79459&seller_num_id=871886077&isFromDetail=yes&totalSQ=87147&sbn=f0e5bea6cbcbe32703a5f60b7a820d08&sold_total_num=19272'
#url4='http://rate.tmall.com/list_detail_rate.htm?itemId=25158784329&spuId=215742447&sellerId=911757567&order=1&append=0&content=1&tagId=&posi=&callback=shop_rate_list&Page=2'
'''
